﻿@using SmartCode
@model BuildContext
@{
    var project = Model.Project;
    var apiProjectName = $"{project.Module}.API";
}

FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS publish
WORKDIR /src
COPY /src .
RUN dotnet publish "@(apiProjectName)/@(apiProjectName).csproj" -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "@(apiProjectName).dll"]